<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>迭代器模式</title>
</head>

<body>  
        function each(data){
            let i = data[Symbol.iterator]()
            console.log(i);
            let item = {done:false}
            while(!item.done){
                item = i.next()
                if(!item.done){
                    console.log(item.value);
                }
            }
        }
        each([{ldq:1,ldq2:2}])
    </script>
</body>

</html>